**********************************************************************************************
set more off



/*
*instructions for outreg;
local instruct_ols "ctitle(OLS) dec(4)  auto(2) symbol(***,**,*) se"; 
local instruct_iv "ctitle(IV) dec(4)  auto(2) symbol(***,**,*) se addstat(First stage F, e(widstat))"; 
local instruct_iv_overid "ctitle(IV) dec(4)  auto(2) symbol(***,**,*)  se addstat(Overid,e(jp),First stage F, e(widstat))"; 
*/


********************************************************************; 
***     TABLE 7 ***
********************************************************************; 


***Panel A
ivreg2 D_censuspop9010_cp larea_cc90 larea_pf05 province_capitalPlus lcensuspop1982_pref frac_highedu1982_pref share_emp_man1982_pref (all_road_2005_rays D_censuspop9010_pref=road_1962_rays ruralMigp00) if D0==1,  first ffirst robust cluster(province05)
outreg2 all_road_2005_rays using "table7", word excel  dec(4)  auto(2) symbol(***,**,*)  se addstat(First stage F, e(widstat))  replace

ivreg2 D_censuspop9010_cp larea_cc90 larea_pf05 province_capitalPlus lcensuspop1982_pref frac_highedu1982_pref share_emp_man1982_pref (all_road_1999_rays D_censuspop9010_pref=road_1962_rays ruralMigp00) if D0==1,  first ffirst robust cluster(province05)
outreg2 all_road_1999_rays using "table7", word excel  dec(4)  auto(2) symbol(***,**,*)  se addstat(First stage F, e(widstat))  append

ivreg2 D_censuspop9000_cp larea_cc90 larea_pf05 province_capitalPlus lcensuspop1982_pref frac_highedu1982_pref share_emp_man1982_pref (all_road_1999_rays D_censuspop9000_pref=road_1962_rays ruralMigp00) if D0==1,  first ffirst robust cluster(province05)
outreg2 all_road_1999_rays using "table7", word excel  dec(4)  auto(2) symbol(***,**,*)  se addstat(First stage F, e(widstat))  append

ivreg2 D_censuspop0010_cp larea_cc90 larea_pf05 province_capitalPlus lcensuspop1982_pref frac_highedu1982_pref share_emp_man1982_pref D_censuspop0010_pref (all_road_1999_rays=road_1962_rays) if D0==1,  first ffirst robust cluster(province05)
outreg2 all_road_1999_rays using "table7", word excel  dec(4)  auto(2) symbol(***,**,*)  se addstat(First stage F, e(widstat))  append

***Panel B - Excluding the West
ivreg2 D_censuspop9010_cp larea_cc90 larea_pf05 province_capitalPlus lcensuspop1982_pref frac_highedu1982_pref share_emp_man1982_pref (all_road_2005_rays D_censuspop9010_pref=road_1962_rays ruralMigp00) if west==0 & D0==1,  first ffirst robust cluster(province05)
outreg2 all_road_2005_rays using "table7", word excel  dec(4)  auto(2) symbol(***,**,*)  se addstat(First stage F, e(widstat))  append

ivreg2 D_censuspop9010_cp larea_cc90 larea_pf05 province_capitalPlus lcensuspop1982_pref frac_highedu1982_pref share_emp_man1982_pref (all_road_1999_rays D_censuspop9010_pref=road_1962_rays ruralMigp00) if west==0 & D0==1,  first ffirst robust cluster(province05)
outreg2 all_road_1999_rays using "table7", word excel  dec(4)  auto(2) symbol(***,**,*)  se addstat(First stage F, e(widstat))  append

ivreg2 D_censuspop9000_cp larea_cc90 larea_pf05 province_capitalPlus lcensuspop1982_pref frac_highedu1982_pref share_emp_man1982_pref (all_road_1999_rays D_censuspop9000_pref=road_1962_rays ruralMigp00) if west==0 & D0==1,  first ffirst robust cluster(province05)
outreg2 all_road_1999_rays using "table7", word excel  dec(4)  auto(2) symbol(***,**,*)  se addstat(First stage F, e(widstat))  append

ivreg2 D_censuspop0010_cp larea_cc90 larea_pf05 province_capitalPlus lcensuspop1982_pref frac_highedu1982_pref share_emp_man1982_pref D_censuspop0010_pref (all_road_1999_rays=road_1962_rays) if west==0 & D0==1,  first ffirst robust cluster(province05)
outreg2 all_road_1999_rays using "table7", word excel  dec(4)  auto(2) symbol(***,**,*)  se addstat(First stage F, e(widstat))  append





*** DD specification is 0
gen DD_censuspop_cp = D_censuspop0010_cp-D_censuspop9000_cp
gen DD_censuspop_pref = D_censuspop0010_pref-D_censuspop9000_pref
ivreg2 DD_censuspop_cp larea_cc90 larea_pf05 province_capitalPlus lcensuspop1982_pref frac_highedu1982_pref share_emp_man1982_pref DD_censuspop_pref (all_road_1999_rays=road_1962_rays) if D0==1,  first ffirst robust cluster(province05)

** Check that results are the same for 2010
ivreg2 D_censuspop9000_cp larea_cc90 larea_pf05 province_capitalPlus lcensuspop1982_pref frac_highedu1982_pref share_emp_man1982_pref (all_road_2010_rays D_censuspop9000_pref=road_1962_rays ruralMigp00) if D0==1,  first ffirst robust cluster(province05)
ivreg2 D_censuspop0010_cp larea_cc90 larea_pf05 province_capitalPlus lcensuspop1982_pref frac_highedu1982_pref share_emp_man1982_pref D_censuspop0010_pref (all_road_2010_rays=road_1962_rays) if D0==1,  first ffirst robust cluster(province05)
